﻿using System.ComponentModel;
using VM.Common.Enums;
using VM.Common.Helper;

namespace Plugin.Defect
{
    [Serializable]
    public class TemplateParamModel : NotifyPropertyBase
    {
        #region  建立模板参数
        public Dictionary<string, string> ParamMap = new Dictionary<string, string>
        {

            { "最强边缘", "Best" },
            { "第一个边缘", "First" },
            { "最后一个边缘", "Last" },
            { "由黑到白边", "Black2White" },
             { "由白到黑边", "White2Black" },
              { "两种类型边", "All" }



        };
        private string _findModeMode = EnumHelper.GetEnumDescription(FindTypes.Best);
        public string FindModeMode
        {
            get { return _findModeMode; }
            set
            {
                Set(ref _findModeMode, value);

            }
        }
        private List<string> _findModeArray = EnumHelper.GetEnumDescriptions<FindTypes>();
        public List<string> FindModeArray
        {
            get { return _findModeArray; }
            set
            {
                Set(ref _findModeArray, value);

            }
        }

        private string _edge0Polarity = EnumHelper.GetEnumDescription(edge0.White2Black);
        public string Edge0Polarity
        {
            get { return _edge0Polarity; }
            set
            {
                Set(ref _edge0Polarity, value);

            }
        }
        private List<string> _edge0PolarityArray = EnumHelper.GetEnumDescriptions<edge0>();
        public List<string> Edge0PolarityArray
        {
            get { return _edge0PolarityArray; }
            set
            {
                Set(ref _edge0PolarityArray, value);

            }
        }
        private string _edge1Polarity = EnumHelper.GetEnumDescription(edge1.White2Black);
        public string Edge1Polarity
        {
            get { return _edge1Polarity; }
            set
            {
                Set(ref _edge1Polarity, value);

            }
        }
        private List<string> _edge1PolarityArray = EnumHelper.GetEnumDescriptions<edge1>();
        public List<string> Edge1PolarityArray
        {
            get { return _edge1PolarityArray; }
            set
            {
                Set(ref _edge1PolarityArray, value);

            }
        }
        private Dictionary<string, bool> _paramBool = new Dictionary<string, bool>();
        public Dictionary<string, bool> ParamBool
        {
            get { return _paramBool; }
            set { Set(ref _paramBool, value); }
        }

        private Dictionary<string, int> _paramInt = new Dictionary<string, int>();
        public Dictionary<string, int> ParamInt
        {
            get { return _paramInt; }
            set { Set(ref _paramInt, value); }
        }

        private Dictionary<string, double> _paramDouble = new Dictionary<string, double>();
        public Dictionary<string, double> ParamDouble
        {
            get { return _paramDouble; }
            set { Set(ref _paramDouble, value); }
        }

        private Dictionary<string, Array> _paramArray = new Dictionary<string, Array>();
        public Dictionary<string, Array> ParamArray
        {
            get { return _paramArray; }
            set { Set(ref _paramArray, value); }
        }

        private Dictionary<string, object> _paramEnum = new Dictionary<string, object>();
        public Dictionary<string, object> ParamEnum
        {
            get { return _paramEnum; }
            set
            {
                Set(ref _paramEnum, value);
            }
        }

        private int _DistCourse = 30;
        public int DistCourse
        {
            get { return _DistCourse; }
            set
            {
                Set(ref _DistCourse, value);
            }
        }
        private int _CaliperWidth = 5;
        public int CaliperWidth
        {
            get { return _CaliperWidth; }
            set
            {
                Set(ref _CaliperWidth, value);
            }
        }
        private int _CaliperHeight = 50;
        public int CaliperHeight
        {
            get { return _CaliperHeight; }
            set
            {
                Set(ref _CaliperHeight, value);
            }
        }
        private int _EdgeStrength = 25;
        public int EdgeStrength
        {
            get { return _EdgeStrength; }
            set
            {
                Set(ref _EdgeStrength, value);
            }
        }
        #endregion

        public TemplateParamModel()
        {
            // 整型数据

            //  ParamInt.Add("卡尺间距", 5);
            //  ParamInt.Add("卡尺宽度", 5);
            //  ParamInt.Add("卡尺高度", 50);
            //  ParamInt.Add("边缘强度", 25);

            //  //  Enum数据
            ////  ParamArray.Add("边缘查找类型", "ModEdgePairFindMode");

            //  ParamArray.Add("阈值模式", Enum.GetValues(typeof()));
            //  //ThresholdMode = HPPatCreateThresholdMode.自动;

        }

        #region 方法

        /// <summary>
        /// 从界面配置更新至Para对象
        /// </summary>
        /// <param name="patternCreateParas"></param>



        #endregion

        [Serializable]
        public enum FindTypes
        {
            [Description("最强边缘")]
            Best,

            [Description("第一个边缘")]
            First,

            [Description("最后一个边缘")]
            Last



        }

        public enum edge0
        {
            [Description("由黑到白边")]
            Black2White,

            [Description("由白到黑边")]
            White2Black,

            [Description("两种类型边")]
            All

        }

        public enum edge1
        {
            [Description("由黑到白边")]
            Black2White,

            [Description("由白到黑边")]
            White2Black,

            [Description("两种类型边")]
            All



        }

    }
}